public class String_Buffer {
    public static void main(String[] args) {
        StringBuffer sb = new StringBuffer();
        sb.append("123");
        sb.append("haha"); //添加字符串
        sb.append("haha2");
        sb.append("haha3");
        sb.insert(2, "it");//在指定位置插入
        sb.delete(1, 4);//删除
        sb.replace(1, 4, "cast");//替换指定范围内的内容
        System.out.println(sb);
    }
}
